/**
* \brief Multimethod implementation 
*	 with 'Visitor' design pattern.
*	 Header file with auxilliary classes - Visitor.
* \author Bartosz Kedra (bartosz.kedra@gmail.com)
*/
#ifndef __VISITOR_HPP__
#define __VISITOR_HPP__

class Figure;
class Circle;
class Rectangle; 

class Visitor
{
public:
	virtual void visit(Circle& c) = 0;
	virtual void visit(Rectangle& r) = 0; 
};

class RectangleVisitor : public Visitor
{
public:
	double val;

	RectangleVisitor(Rectangle &r) : rec(r) {}
	virtual void visit(Circle &c);
	virtual void visit(Rectangle &r);
private:
	Rectangle &rec;
};

class CircleVisitor : public Visitor
{
public:
	double val;

	CircleVisitor(Circle &c) : cir(c) {}
	virtual void visit(Circle &c);
	virtual void visit(Rectangle &r);
private:
	Circle& cir;
};

class IntersectVisitor : public Visitor
{
public:
	double val;
	IntersectVisitor(Figure &fig) : figure(fig) {} 

	virtual void visit(Circle& c);
	virtual void visit(Rectangle& r);
private:
	Figure &figure;
};

#endif /* __VISITOR_HPP__ */
